﻿
namespace Marmat.Forms.Views
{
    namespace GridControl
    {
        public class RowColEventArgs : GridEventArgs
        {
            private Grid.RowColEventArgs _args;

            internal RowColEventArgs(Forms.GridControl gridControl, Grid.RowColEventArgs args) : base(gridControl)
            {
                this._args = args;
            }

            /// <summary>
            /// 返回准备编辑的行。
            /// </summary>
            public object Row
            {
                get => this._args.Row;
            }

            /// <summary>
            /// 返回准备编辑的列。
            /// </summary>
            public Grid.Column Column
            {
                get => this._args.Column;
            }

            /// <summary>
            /// 获取当前单元格的值。
            /// </summary>
            public object CellValue
            {
                get => this.GridControl.GetRowCellValue(this.RowHandle, this.Column);
            }

            /// <summary>
            /// 返回准备编辑的行号。
            /// </summary>
            /// <returns></returns>
            public int RowHandle
            {
                get => this._args.RowHandle;
            }
        }
    }
}